<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title></title>
    <link rel="stylesheet" href="__STATIC__/css/mui.min.css"/>
    <link rel="stylesheet" href="__STATIC__/css/common.css">
    <link rel="stylesheet" href="__STATIC__/css/module.css"/>
    <script src="__STATIC__/js/jquery.min.js"></script>
    <script src="__STATIC__/js/mui.min.js"></script>
</head>

<body>
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-arrowleft mui-pull-left" href="{:url('index/User/shezhi')}"></a>
    <h1 class="mui-title">收货地址</h1>
</header>
<div class="mui-content">
    <div class="address-wrap">
{volist name="arr" id="val"} 
        <div class="item">
            <a href="#">
                <h4 class="mui-clearfix">{$val.realname} <span class="mui-pull-right"$val.mobile}</span></h4>
                <p>{$val.city_str}{$val.address}</p>
            </a>
            <div class="links">
            {if condition="$val.status eq 2"} 
                <a class="def active" href="javascript:" onclick="moren(1,{$val.address_id});">默认地址</a>
                {else}
                <a class="def" href="javascript:" onclick="moren(2,{$val.address_id});" >设为默认地址</a>
                {/if}
                
                <a class="mui-pull-right delete marl10" href="javascript:" onclick="moren(3,{$val.address_id});">删除</a>
                <a class="mui-pull-right edit" href="{:url('index/User/updizhi',array('id'=>$val['address_id']))}">编辑</a>
            </div>
        </div>
 {/volist}
       
    </div>
    <a class="add-new" href="{:url('index/User/tianjiadizhi')}"><span class="mui-icon mui-icon-plus"></span>添加收货地址</a>
</div>
</body>
<script type="text/javascript">

mui(document.body).on('tap','a',function(){
		document.location.href=this.href;
	});
function moren(ty,id){

url = "{:url('index/User/moren')}";
            $.post(url, {ty:ty,id:id}, function (data) {
                
                    alert("操作成功");
                   location.reload();
            })
}
</script>
</html>